<!--
setup原理
<script>
import { ref } from 'vue'
export default {
  setup() {
    const add = () => count.value++
    const cut = () => count.value--
    const count = ref(0)
    return { cut, add, count }
  }
}
</script>
-->
<script setup>
import { ref } from 'vue'
const count = ref(100)
const add = () => {
  count.value++
}
const cut = () => {
  count.value--
}
</script>

<template>
  <div>
    <button @click="cut">-</button>
    {{ count }}
    <button @click="add">+</button>
  </div>
</template>

<style scoped></style>